<template>
    <div>
        <el-card class="box-card">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>订单信息</el-breadcrumb-item>
            </el-breadcrumb>
            <el-form ref="form" :model="form" label-width="80px">
                <el-form-item label="到货日期">
                    <el-col :span="11">
                        <el-date-picker type="date" placeholder="选择日期" v-model="form.date1"
                                        style="width: 100%;"></el-date-picker>
                    </el-col>

                </el-form-item>
                <el-form-item label="备注" label-width="200">

                    <el-col :span="11">
                        <el-input
                                type="textarea"
                                :rows="2"
                                placeholder="请输入内容"
                                v-model="form.beizu">
                        </el-input>
                    </el-col>
                </el-form-item>

            </el-form>

        </el-card>

        <!--商品信息-->
        <el-card class="box-card">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>商品信息</el-breadcrumb-item>
            </el-breadcrumb>
            <el-button type="primary" @click="showGoodForm = true">添加商品</el-button>
            <el-table :data="goodData">
                <el-table-column v-for="item in tableColumn "
                                 :prop="item.prop"
                                 :label="item.label"
                                 :width="item.width">
                </el-table-column>
                <el-table-column
                        fixed="right"
                        label="操作"
                        width="150">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" @click="handleChoose(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>

        <!--商品信息-->
        <el-card class="box-card">
            <el-button type="primary" @click="showGoodForm = false">保存</el-button>
            <el-button @click="showGoodForm = false">取 消</el-button>
        </el-card>


        <el-dialog title="收货地址" :visible.sync="showGoodForm">
            <el-table :data="goodData">
                <el-table-column
                        type="selection"
                        width="55">
                </el-table-column>
                <el-table-column v-for="item in tableColumn "
                                 :prop="item.prop"
                                 :label="item.label"
                                 :width="item.width">
                </el-table-column>
                <el-table-column
                        fixed="right"
                        label="操作"
                        width="150">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" @click="handleChoose(scope.row)">选择</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="showGoodForm = false">添加</el-button>
                <el-button @click="showGoodForm = false">取 消</el-button>

  </span>
        </el-dialog>


    </div>
</template>

<script>
  export default {
    name: 'add',
    data() {
      return {
        form: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: '',
          beizu: '',
        },
        showGoodForm: false,
        tableColumn: [
          {
            prop: 'skuDM',
            label: 'sku代码',
          }, {
            prop: 'sprName',
            label: '商品名',
          }, {
            prop: 'guige',
            label: '规格',
          }, {
            prop: 'danwei',
            label: '单位',
          }, {
            prop: 'leimu',
            label: '类目',
          }, {
            prop: 'cpsx',
            label: '产品属性',
          }, {
            prop: 'bzjg',
            label: '标准价',
          }, {
            prop: 'yaohuoConts',
            label: '要货数量',
          }, {
            prop: 'allMoney',
            label: '要货金额',
          },
        ],
        goodData: [
          {
            skuDM: '6145',
            sprName: '经典C系列被罩两件套（单人）',
            guige: '150×215',
            danwei: '套',
            leimu: '件套',
            cpsx: '面辅料',
            bzjg: '218.7281',
            yaohuoConts: '1',
            allMoney: '32737',
          }, {
            skuDM: '6145',
            sprName: '经典C系列被罩两件套（单人）',
            guige: '150×215',
            danwei: '套',
            leimu: '件套',
            cpsx: '面辅料',
            bzjg: '218.7281',
            yaohuoConts: '1',
            allMoney: '32737',
          }, {
            skuDM: '6145',
            sprName: '经典C系列被罩两件套（单人）',
            guige: '150×215',
            danwei: '套',
            leimu: '件套',
            cpsx: '面辅料',
            bzjg: '218.7281',
            yaohuoConts: '1',
            allMoney: '32737',
          }, {
            skuDM: '6145',
            sprName: '经典C系列被罩两件套（单人）',
            guige: '150×215',
            danwei: '套',
            leimu: '件套',
            cpsx: '面辅料',
            bzjg: '218.7281',
            yaohuoConts: '1',
            allMoney: '32737',
          },
        ],
      };
    },
    methods: {
      onSubmit() {
        console.log('submit!');
      },
      //选择
      handleChoose(row) {

      },
    },
  };
</script>

<style scoped>

</style>
